import axios from "axios";
const deleteIds = [
    "xy8250",
    "xy530",
    "xy2856",
    "xy6126",
    "xy8174",
    "xy5392",
    "xy9317",
]
//拉下生产的数据
export default async () => {
    let options = {
        method: "post",
        data: {"parameterStr":[
            "mall_templet"
        ]},
        url: "https://njxs.weilian.cn" + "/resourceLevel/getMallParameter",
    }

    let result = await axios(options);
    console.log("打印数据", result);
    //拿到模板数据
    let template = JSON.parse(result.data.data[0][3].value);
    //找到启用的
    template = template.templateConfigList.find(item => item.tpState);
    //拿到tpConfig
    template = JSON.parse(template.tpConfig);
    
    //根据要删除的id进行删除组件
    for (let i = template.home.content.length - 1; i >= 0; i--) {
        if (deleteIds.includes(template.home.content[i].id)) {
            template.home.content.splice(i, 1);
        }
    }
    // console.log("打印数据", template);
    return {
        tpConfig: JSON.stringify(template),
        storeCode: "1490",
        enterpriseCode: "NINGJIAXIANSHENG",
        tpName: "首页模板数据修正",
        tpDesc: "首页模板数据修正",
        sessionId: "1b30d655fb4141fe9dd50d4273a3b6e3",
    }
    
}